package me.zhengjie.modules.other.service.dto;

import com.alibaba.druid.util.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @author QF2019
 */
@Data
@ApiModel("保存房源状态")
public class SavePropertyStatusDto {

    @NotNull(message = "id不能为空")
    @ApiModelProperty("id")
    private String id;

    @ApiModelProperty(value = "是否主推", hidden = true)
    private Boolean recommend;

    @NotNull(message = "上/下架状态不能为空")
    @ApiModelProperty(value = "上架/下架")
    private String upDownFlag;

    @ApiModelProperty("是否主推，是/否")
    private String recommendStr;

    public Boolean getRecommend(){
        return StringUtils.equals("是", getRecommendStr());
    }
}
